<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>020自增和自减</title>
</head>

<body>
  <h1>020自增和自减</h1>
  <script>
    /*
      1 自增
        前自增 ++i
        后自增 i++

      2 自减
        前自减 --i
        后自减 i--
    */
    let i = 1
    console.log(++i + 1) // 3

    let j = 1
    console.log(j++ + 1) // 2

    let k = 1
    console.log(k++ + ++k + k) // 7
  </script>
</body>

</html>